<?php
/**
 * Created by PhpStorm.
 * User: slcboy
 * Date: 18-4-25
 * Time: 下午8:21
 */

//添加cookie
setcookie("name", "zxf", time() + 3600);
//数组


$arr = array(1, 2, 3);
$arr_str = serialize($arr);
setcookie("a", $arr_str, time() + 3600);

//获取cookie

var_dump($_COOKIE);

//更新cookie

setcookie("name", "aaa", time() + 3600);

//删除cookie

setcookie("name", "", time() - 20);

//删除所有

foreach ($_COOKIE as $key => $value) {
    setcookie($key, "", time() - 1);
}
echo "成功";
?>